//
//  ProvincesModel.m
//  Shengzhuli
//
//  Created by 卡忙科技 on 16/11/8.
//  Copyright © 2016年 kamangkeji. All rights reserved.
//

#import "ProvincesModel.h"

@implementation ProvincesModel

- (instancetype)initWithDict:(NSDictionary *)dict
{
    if (self = [super init]) {
        NSMutableArray *cities = [NSMutableArray array];
        for (NSDictionary *cityDict in dict[@"cityList"]) {
            CityModel *model = [CityModel cityWithDict:cityDict];
            [cities addObject:model];
        }
        self.cityList = cities;
        self.firstLetter = dict[@"firstLetter"];
        self.ID = [dict[@"id"] integerValue];
        self.name = dict[@"name"];
        self.parentId = [dict[@"parentId"] integerValue];
    }
    return self;
}

+ (instancetype)objectWithDict:(NSDictionary *)dict
{
    return [[ProvincesModel alloc]initWithDict:dict];
}

@end
